//接口API统一管理
import axios, { ResponseData } from 'yuxin-base/src/utils/axios'

export default {
	/**
	 * 校验是否可以开始开票
	 * @param data
	 * @returns
	 */
	verify(data: object): Promise<ResponseData> {
		return axios.request({
			url: '/finance/invoice/invoicing/verify',
			data,
			method: 'POST'
		})
	},

	/**
	 * 查询账单收支 个人 包租
	 * @param data
	 * @returns
	 */
	getFinance(data: object): Promise<ResponseData> {
		return axios.request({
			url: '/finance/finance_bill/get_finance_by_contract',
			data,
			method: 'POST'
		})
	},


	/**
	 * 获取账单明细可开票金额
	 * @param data
	 * @returns
	 */
	getInvoiceAmount(data: object): Promise<ResponseData> {
		return axios.request({
			url: '/finance/invoice/invoicing/bill_detail/invoice_amount',
			data,
			method: 'POST'
		})
	},

	/**
	 * 发起开票预览
	 * @param data
	 * @returns
	 */
	getview(data: object): Promise<ResponseData> {
		return axios.request({
			url: '/finance/invoice/invoicing/view',
			data,
			method: 'POST'
		})
	},

	/**
	 * 通过spi模糊匹配企业名称
	 * @param data
	 * @returns
	 */
	matching(data: object): Promise<ResponseData> {
		return axios.request({
			url: '/finance/invoice/org_info/spi/name_matching',
			data,
			method: 'POST'
		})
	},

	/**
	 * 发起开票
	 * @param data
	 * @returns
	 */
	blue(data: object): Promise<ResponseData> {
		return axios.request({
			url: '/finance/invoice/invoicing/blue',
			data,
			method: 'POST'
		})
	},




	/**
	 * 开票补录
	 * @param data
	 * @returns
	 */
	historicalBlue(data: object): Promise<ResponseData> {
		return axios.request({
			url: '/finance/invoice/historical/invoicing/blue',
			data,
			method: 'POST'
		})
	},

	/**
	 * 开票列表查询
	 * @param data
	 * @returns
	 */
	infos(data: object): Promise<ResponseData> {
		return axios.request({
			url: '/finance/invoice/invoicing/infos',
			data,
			method: 'POST'
		})
	}
}
